#ifndef KDTRAVERSALSTACK_H_
#define KDTRAVERSALSTACK_H_

#include "constants.h"
class KdNode;

struct StackEntry
{
	const KdNode* node;
	float near;
	float far;
};

class KdTraversalStack
{
public:
	KdTraversalStack();
	~KdTraversalStack();
	
	void push(const KdNode* node, float near, float far);
	inline const StackEntry& pop(void) { return stack[cur--]; }
	inline bool isEmpty(void) const { return cur == -1; }
	inline void clear(void) { cur = -1; }
protected:
	StackEntry stack[MAXKDTREEDEPTH];
	int cur;
private:
	KdTraversalStack(const KdTraversalStack& copy) {}
	
};

#endif /*KDTRAVERSALSTACK_H_*/
